Defrecord names a macro, with lambda list (NAME (DATABASE TABLE &KEY PULL ID-COLUMN) &REST COLUMNS):
Define a database-mapping object type NAME, for DATABASE and TABLE, with COLUMNS.
DATABASE is the symbolic name of the database, mapped via TOOTSVILLE CONFIG; eg, :friendly
TABLE is the string table-name, exactly as it exists in the database; eg, "toots"
PULL is meant to indicate an infrequently-changed, short table (ie, basically a small enumeration) that should be pulled into local cache up-front and referenced from there directly.
COLUMNS are a table of names, types, and foreign-key references, in the form: (LABEL TYPE &rest REFERENCE)
The LABEL of a column is mapped via TOOTSVILLE LISP-TO-DB-NAME; it is the Lisp name which is essentially the same as the SQL name, but with KEBAB-CASE rather than snake_case.
When present, REFERENCE is the symbol REF followed by the record-type (class) to whose primary key (ID or UUID) the reference is made. NUMBER REF columns point to ID, UUID REF columns to UUID.
TYPE is one of the following:
Defined in file src/db/db-central.lisp.